<!DOCTYPE html>
<html lang="">
<head>
<meta charset="utf-8">
<title>Parqueadero</title>
<meta name="description" content="" />
<meta name="keywords" content="" />
<meta name="robots" content="" />
<meta name="viewport" content="width=device-width, minimum-scale=1.0, maximum-scale=1.0">
<link rel="stylesheet" href="plantilla/css/style.css" media="all" />
<link rel="shortcut icon" href="parqueadero.png">
<link rel="stylesheet" href="componentes/noti/messi.min.css" />
<!--[if IE]><link rel="stylesheet" href="css/ie.css" media="all" /><![endif]-->
</head>
<body class="login">
<section>
  <h1><strong>Sistema </strong> Parqueadero</h1>
  <form  id="formulario" name="formulario" method="POST"  action="componentes/librerias/controlador/controlador_login.php">
    <ul class="inputs black-input large">
      <li><span class="icon-user mid-margin-right"></span>
        <input name="entrada[]"  class="input-unstyled"  type="text" id="login" placeholder="Usuario" autocomplete="off"  >
      </li>
      <li><span class="icon-lock mid-margin-right"></span>
        <input name="entrada[]"  class="input-unstyled"  type="password" id="pass" placeholder="Clave"  autocomplete="off" >
      </li>
    </ul>
    <input type="hidden" name="entrada[]" id="ip" value="<?php echo $_SERVER['REMOTE_ADDR']; ?>" />
    <input type="hidden" name="entrada[]" id="fecha" value="<?php echo  $_SESSION["ultimoacceso"] = date("Y-n-j H:i:s"); ?>" />
    <button type="submit" class="blue">Ingreso</button>
  </form>
  <p><a href="#">Forgot your password?</a></p>
</section>
<script src="componentes/js/jquery10.2.js" ></script> 
<script src="componentes/noti/messi.js"></script> 
<script>

if (window.webkitNotifications) {
  console.log("Notifications are supported!");
}
else {
  console.log("Notifications are not supported for this Browser/OS version yet.");
}

  var notification = window.webkitNotifications.createNotification("parqueadero.png", "Simple Background App",
     '<img src="parqueadero.png" width="256" height="256"  alt=""/> dg');
	  



  notification.show();
  console.log("-> log");
console.debug('-> debug');
console.warn('-> warm');
console.error('-> error');
</script> 
<script type="text/javascript">
		
				$(document).ready(function() {
	


    $('#formulario').submit(function() {
        $.ajax({
     type: 'POST',
			dataType: "json",
            url: $(this).attr('action'),
            data: $(this).serialize(),
			beforeSend: function(objeto){
         //   alert("Adiós, me voy a ejecutar");
        },
		error: function(){alert('ocurrio un error !!');},
		complete: function(){$("#formulario").reset();},
		
            success: function(data) {
				
									
							if (data.info == "exitoso")
					  			{
							
									// Simulate server-side check
	new Messi('ingreso exitoso', {title: 'bienvenido', titleClass: 'success', center: false, viewport: {top: '10px', left: '10px'}, autoclose: 1000, closeButton: true});
setTimeout(function() {	document.location.href = 'inicio.php'}, 100);
					  				
					  			}
					  			else
					  			{
					  		new Messi('Válido de usuario / contraseña, por favor inténtalo de nuevo.', {title: 'Error registro', titleClass: 'anim error', center: false, viewport: {top: '10px', left: '10px'}, autoclose: 3000, closeButton: true});
							
					

					  			}
				
                $('#resultado').html(data);}
			
        }).done(function(data ) {
$('#formulario').each(function(){
  this.reset();
});



});
        
        return false;
    }); 
})  
					


</script>
<div id="resultado" style="color: #FFFFFF"></div>
</body>
</html>